#pragma once
#include "../utils/factory.hh"
#include "../config/config.hh"
#include "../platform/platform.hh"

namespace ngintoy
{
    namespace renderer
    {
        using config::config;
        using platform::platform;

        struct renderer : utils::factory<renderer, config &, platform &>
        {
            virtual void render() = 0;

            // - POST CONDITION
            //   have at least 1 renderer
            static void validate()
            {
                if (registry().size() == 0)
                    throw std::logic_error{"no renderer available? WTF?!"};
            }

        protected:
            renderer() {}
        };
    }
}

